home *** CD-ROM | disk | FTP | other *** search
/ PC Guide Interactive 5 / PC Guide Issue 5 (Future Publishing) (1995).iso / win95 / mdialogs.dir / 00061_Script_61 < prev    next >
Text File  |  1995-05-22  |  3KB  |  113 lines

  1. -- dialogs movie scripts
  2.  
  3. on startmovie
  4.   if the machineType = 256 then
  5.     set the exitlock to TRUE
  6.   end if
  7. end 
  8.  
  9. on setSprites default
  10.   global gCurrDialogButtonDM
  11.   put default into gCurrDialogButtonDM
  12.   puppetSprite 2,1
  13.   puppetSprite 3,1
  14.   if the castNum of sprite 4 <> 0 then
  15.     puppetSprite 4,1
  16.   end if
  17. end
  18.  
  19. on keyDown
  20.   global gCurrDialogButtonDM
  21.   if voidP(gCurrDialogButtonDM) then put 2 into gCurrDialogButtonDM
  22.   put gCurrDialogButtonDM into lastsprite
  23.   
  24.   if the Key = TAB then
  25.     --hilite next or previous button
  26.     
  27.     if the castNum of sprite 4 = 0 then put 3 into limit
  28.     else put 4 into limit
  29.     
  30.     if not the shiftDown then
  31.       if lastSprite < limit then
  32.         set gCurrDialogButtonDM = gCurrDialogButtonDM+1
  33.       else
  34.         set gCurrDialogButtonDM = 2
  35.       end if
  36.     else
  37.       if lastSprite = 2 then
  38.         set gCurrDialogButtonDM = limit
  39.       else
  40.         set gCurrDialogButtonDM = gCurrDialogButtonDM-1
  41.       end if
  42.     end if
  43.     
  44.     
  45.     -- de hilite the last sprite that was hilited
  46.     set c = the castNum of sprite lastsprite
  47.     set the castNum of sprite lastsprite = c -1
  48.     set c = the castNum of sprite gCurrDialogButtonDM
  49.     set the castNum of sprite gCurrDialogButtonDM = c+1
  50.     updateStage
  51.     
  52.   else if the key = RETURN or the key = ENTER then
  53.     hiliteButton lastSprite 
  54.     mouseDown(script the scriptNum of sprite (lastsprite))
  55.   end if
  56. end
  57.  
  58.  
  59. on dialogButtonChoice c
  60.   global gDialogResult,gDialogCallBack
  61.   put c into gDialogResult
  62.   -- return the the button choice to the main movie by calling the calling handler
  63.   -- and passing the response
  64.   if count(the windowList) > 0 then   -- we're running in the main movie
  65.     tell the stage 
  66.       do gDialogCallBack
  67.     end tell
  68.   else
  69.     beep
  70.     --alert c
  71.   end if
  72. end
  73.  
  74. on hiliteButton s
  75.   -- hilite the suckers by moving down and up a pixel
  76.   if voidP(s) then
  77.     --alert string(the lastClick)
  78.     if the lastClick < 20 then
  79.       put the clickOn into s
  80.     else 
  81.       exit
  82.     end if
  83.   end if
  84.   put the locH of sprite s into h
  85.   put the locV of sprite s into v
  86.   
  87.   set the locH of sprite s to h + 2
  88.   set the locV of sprite s to v + 2
  89.   updateStage
  90.   wait
  91.   set the locH of sprite s to h
  92.   set the locV of sprite s to v
  93.   wait
  94.   updateStage
  95. end
  96.  
  97.  
  98. on dialogWidth
  99.   return the width of sprite 1
  100.   
  101. end
  102.  
  103. on dialogHeight
  104.   return the height of sprite 1
  105. end
  106.  
  107. on wait t
  108.   if voidP(t) then set t = 10
  109.   startTimer
  110.   repeat while the timer < t
  111.     nothing
  112.   end repeat
  113. end